<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #canvas {
            background: rebeccapurple;
        }
    </style>
</head>

<body>
    <canvas id="canvas"></canvas>
</body>

<script type="module">
    import { Color } from 'https://unpkg.com/three/build/three.module.js';

    window.onload = function () {


        const canvas = document.getElementById("canvas");
        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;

        //三维画笔
        const gl = canvas.getContext("webgl");

        const color = new Color("rgba(255,255,0,1)");
        gl.clearColor(color.r, color.g, color.b, color.a);
        //清空
        gl.clear(gl.COLOR_BUFFER_BIT);



        !(function ani() {
            color.offsetHSL(0.001, 0.000, 0.000);

            gl.clearColor(color.r, color.g, color.b, 1);
            gl.clear(gl.COLOR_BUFFER_BIT);
            requestAnimationFrame(ani);
        })();

    }



</script>

</html>